{include file="public/layout" /}
{include file="gzh/header" /}
<link href="__SKIN__/css/gzh/bootstrap.min.css?v={$version}" rel="stylesheet" type="text/css" />
<link href="__SKIN__/css/gzh/wx-audiocopy.css?v={$version}" rel="stylesheet" type="text/css" />
<link href="__SKIN__/css/gzh/selfmenu.css?v={$version}" rel="stylesheet" type="text/css" />
<link href="__SKIN__/css/gzh/bottom.css?v={$version}" rel="stylesheet" type="text/css" />
<link href="__SKIN__/css/gzh/scroll.css?v={$version}" rel="stylesheet" type="text/css" />
<link href="__SKIN__/css/gzh/wx-custom.css?v={$version}" rel="stylesheet" type="text/css" />
<body class="bodystyle" style="overflow-y: scroll; cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
{include file="canal/left" /}
<div class="page min-hg-c-10" style="min-width:auto;margin-left:100px;">
	<div class="fixed-bar">
		<div class="item-title">
			<a class="back_xin" href="{:url('Gzh/index')}" title="返回"><i class="iconfont e-fanhui"></i></a>
			<!-- <a class="back_sz mt10" href="javascript:void(0);"
			   onclick="click_to_eyou_1575506523('https://www.eyoucms.com/plus/view.php?aid=10970&origin_eycms=1', '微信公众号配置指南');"><i
					class="ui_tips"></i>使用教程</a> -->
			<div class="subject">
				<h3>菜单管理</h3>
				<h5></h5>
			</div>
		</div>
	</div>
	<div class="jzy_desktop_panel" style="padding: 70px;padding-top: 50px;">

		<!-- 自定义菜单 -->
		<form id="post_form" method="post">
			<div class="custom-menu-edit-con">
				<div class="hbox">
					<div class="inner-left">
						<div class="custom-menu-view-con">
							<div class="custom-menu-view">
								<div class="view_title">公众号名称</div>
								<div class="view_body">
									<div class="weixin-msg-list">
										<ul class="msg-con"></ul>
									</div>
								</div>
								<div id="menuMain" class="view_footer">
									<div class="view_footer_left"></div>
									<!--菜单-->
									<div class="view_footer_right" style="display: flex;flex-wrap: wrap;">
										{foreach name="$list" item="vo" key="k" }
										<div class="view_menu view_menu_{$k+1}" data-number="{$k+1}">
											<div id="title_{$k+1}" class="text-ellipsis" onclick="changeSubbuttonActived(this,{$k+1},0);">{$vo.title}</div>
											<ul class="view_menu-sub">
												{foreach name="$vo.child" item="voo" key="kk" }
												<li onclick="changeSubbuttonActived(this,{$k+1},{$kk+1});" id="sub_{$k+1}_{$kk+1}" data-number="{$k+1}"><div id="title_{$k+1}_{$kk+1}" class="text-ellipsis">{$voo.title}</div></li>
												{/foreach}
												{if condition="!empty($vo.child) && count($vo.child) < 5 "}
												<li class="add-second"><div class="text-ellipsis" onclick="addSecondMenu(this);" data-parentnumber="{$k+1}"><i class="glyphicon glyphicon-plus text-info"></i></div></li>
												{/if}
											</ul>
										</div>
										{/foreach}
										{if condition="count($list) < 3 "}
										<div class="view_menu add-first-menu" id="view_menu_add">
											<div class="text-ellipsis" onclick="addFirstMenu();"><i class="glyphicon glyphicon-plus text-info iBtn"></i></div>
										</div>
										{/if}
									</div>
								</div>
							</div>
						</div>
					</div>
						<div class="inner-right">
							<div class="cm-edit-before none">
								<h5>点击左侧菜单进行操作</h5>
							</div>
							{foreach name="$list" item="vo" key="k" }
							<div class="cm-edit-after none" id="right_form_{$k+1}" data-label="_{$k+1}">
								<div class="cm-edit-right-header">
									<span id="cm-tit"></span>
									<a class="pull-right" href="javascript:void(0);" onclick="delMenu(this,1);">删除菜单</a></div>
								<div class="form-horizontal wrapper-md">
									<div class="form-group">
										<label class="col-sm-2 control-label">菜单名称:</label>
										<div class="col-sm-5">
											<input name="data[{$k+1}][value][title]" type="text" class="form-control" value="{$vo.title}" oninput="changeInput(this);" maxlength="20">
										</div>
										<div class="col-sm-5 help-block">
											<div>字数不超过4个汉字或8个字符</div>
										</div>
									</div>
									<div class="form-group" >
										<label class="col-sm-2 control-label">菜单内容:</label>
										<div class="col-sm-10 LebelRadio">
											<label class="checkbox-inline"> <input type="radio" onclick="changeRadio(this);" name="data[{$k+1}][value][menu]" value="sendmsg" {eq name="$vo.type" value="sendmsg"}checked="checked"{/eq}> 发送消息</label>
											<label class="checkbox-inline"> <input type="radio" onclick="changeRadio(this);" name="data[{$k+1}][value][menu]" value="view" {eq name="$vo.type" value="view"}checked="checked"{/eq}> 跳转网页</label>
											<label class="checkbox-inline"> <input type="radio" onclick="changeRadio(this);" name="data[{$k+1}][value][menu]" value="click" {eq name="$vo.type" value="click"}checked="checked"{/eq}> 触发关键字</label>
											<label class="checkbox-inline"> <input type="radio" onclick="changeRadio(this);" name="data[{$k+1}][value][menu]" value="miniprogram" {eq name="$vo.type" value="miniprogram"}checked="checked"{/eq}> 跳转小程序</label>
											<!--<label class="checkbox-inline"> <input type="radio" onclick="changeRadio(this);" name="data[{$k+1}][value][menu]" value="scancode_push" {eq name="$vo.type" value="scancode_push"}checked="checked"{/eq}> 扫码（推事件）</label>-->
											<!--<label class="checkbox-inline"> <input type="radio" onclick="changeRadio(this);" name="data[{$k+1}][value][menu]" value="scancode_waitmsg" {eq name="$vo.type" value="scancode_waitmsg"}checked="checked"{/eq}> 扫码（等待信息）</label>-->
											<!--<label class="checkbox-inline"> <input type="radio" onclick="changeRadio(this);" name="data[{$k+1}][value][menu]" value="pic_sysphoto" {eq name="$vo.type" value="pic_sysphoto"}checked="checked"{/eq}> 系统拍照发图</label>-->
											<!--<label class="checkbox-inline"> <input type="radio" onclick="changeRadio(this);" name="data[{$k+1}][value][menu]" value="pic_photo_or_album" {eq name="$vo.type" value="pic_photo_or_album"}checked="checked"{/eq}> 拍照或者相册发图</label>-->
											<!--<label class="checkbox-inline"> <input type="radio" onclick="changeRadio(this);" name="data[{$k+1}][value][menu]" value="pic_weixin" {eq name="$vo.type" value="pic_weixin"}checked="checked"{/eq}> 微信相册发图</label>-->
											<!--<label class="checkbox-inline"> <input type="radio" onclick="changeRadio(this);" name="data[{$k+1}][value][menu]" value="location_select"{eq name="$vo.type" value="location_select"}checked="checked"{/eq}> 地理位置</label>-->
										</div>
									</div>
								</div>
								<div class="cm-edit-content-con {neq name='$vo.type' value='sendmsg'}none{/neq}" id="edit_sendmsg">
									<div class="editTab">
										<div class="editTab-heading">
											<ul class="msg-panel-tab">
												<li class="msg-tab_item {eq name='$vo.material.type' value='2'} on {/eq}" onclick="changeType(this,'pic')">
													<span class="msg-icon msg-icon-tuwen"></span>
													图文消息
												</li>
												<!--<li class="msg-tab_item {eq name='$vo.material.type' value='1'} on {/eq}" onclick="changeType(this,'text')">-->
													<!--<span class="msg-icon msg-icon-word"></span>-->
													<!--文本-->
												<!--</li>-->
											</ul>
										</div>
										<div class="editTab-body">
											<div class="msg-panel-context">
												{notempty name="$vo.material_id"}
												<div class="msg-template">
													<input type="hidden" name="data[{$k+1}][value][material_id]" value="{$vo.material_id}">
													{eq name="$vo.material.type" value="1"}
													{$vo.material.intro}
													{else/}
													<img src="{$vo.material.litpic}" alt="">
													<div>{$vo.material.title}</div>
													{/eq}
												</div>
												{else/}
												<div class="msg-context-item" data-href="{:url('Gzh/selcet_material_list',['type'=>2])}" onclick="openFullframe(this, '选择素材', '80%', '80%');">
													<div class="msg-panel-center msg-panel-center">
														<span class="message-plus">+</span><br>从素材库中选择</div>
												</div>
												{/notempty}
											</div>
										</div>
									</div>
								</div>

								<div class="cm-edit-content-con {neq name='$vo.type' value='view'}none{/neq}" id="edit_view"">
									<div class="cm-edit-page">
										<div class="row">
											<label class="col-sm-2 control-label" style="text-align: left;">点击菜单跳转到以下链接:</label>
											<div class="col-sm-5">
												<input type="text" name="data[{$k+1}][value][jump_url]" value="{$vo.jump_url}" class="form-control" placeholder="认证号才可手动输入地址">
												<span class="help-block">必填,必须是正确的URL格式</span>
											</div>
										</div>
									</div>
								</div>

								<div class="cm-edit-content-con {neq name='$vo.type' value='click'}none{/neq}" id="edit_click">
									<div class="cm-edit-page">
										<div class="row">
											<label class="col-sm-2 control-label" style="text-align: left;width: 150px;">关键字:</label>
											<input type="text" style="width: 200px;" id="key_{$k+1}"  name="data[{$k+1}][value][key]" value="{$vo.key}" class="form-control" placeholder="必填,不超过128字节">
											<span class="key-choose" data-href="{:url('Gzh/selcet_keyword_list')}" onclick="openFullframe(this, '选择关键字', '80%', '80%');">选择</span>
										</div>
									</div>
								</div>

								<div class="cm-edit-content-con {neq name='$vo.type' value='edit_miniprogram'}none{/neq}" id="edit_miniprogram">
									<div class="cm-edit-page">
										<div class="row">
											<label class="col-sm-2 control-label" style="text-align: left;">网页链接:</label>
											<div class="col-sm-5">
												<input type="text" name="data[{$k+1}][value][url]" value="{$vo.url}" class="form-control" placeholder="认证号才可手动输入地址">
												<span class="help-block">必填,不支持小程序的老版本客户端将打开本url</span>
											</div>
										</div>
										<div class="row">
											<label class="col-sm-2 control-label" style="text-align: left;">小程序appid:</label>
											<div class="col-sm-5">
												<input type="text" name="data[{$k+1}][value][appid]" value="{$vo.appid}" class="form-control" placeholder="仅认证公众号可配置">
												<span class="help-block">必填</span>
											</div>
										</div>
										<div class="row">
											<label class="col-sm-2 control-label" style="text-align: left;">小程序的页面路径(pagepath):</label>
											<div class="col-sm-5">
												<input type="text" name="data[{$k+1}][value][path]" value="{$vo.path}" class="form-control" placeholder="pages/index/index">
												<span class="help-block">必填</span>
											</div>
										</div>
									</div>
								</div>

							</div>
								{foreach name="$vo.child" item="voo" key="kk" }
								<div class="cm-edit-after none" id="right_form_{$k+1}_{$kk+1}" data-label="_{$k+1}_{$kk+1}">
									<div class="cm-edit-right-header">
										<!--<span id="cm-tit"></span>-->
										<a class="pull-right" href="javascript:void(0);" onclick="delMenu(this,2);">删除菜单</a></div>
									<div class="form-horizontal wrapper-md">
										<div class="form-group">
											<label class="col-sm-2 control-label">菜单名称:</label>
											<div class="col-sm-5">
												<input name="data[{$k+1}][child][{$kk+1}][title]" type="text" value="{$voo.title}" oninput="changeInput(this);" class="form-control" maxlength="8">
											</div>
											<div class="col-sm-5 help-block">
												<div>字数不超过5个汉字或16个字符</div>
												<div class="font_sml" style="display: block;">若无二级菜单，可输入20个汉字或60个字符</div>
											</div>
										</div>
										<div class="form-group" >
											<label class="col-sm-2 control-label">菜单内容:</label>
											<div class="col-sm-10 LebelRadio">
												<label class="checkbox-inline"> <input type="radio" onclick="changeRadio(this);" name="data[{$k+1}][child][{$kk+1}][menu]" value="sendmsg" {eq name="$voo.type" value="sendmsg"}checked="checked"{/eq}> 发送消息</label>
												<label class="checkbox-inline"> <input type="radio" onclick="changeRadio(this);" name="data[{$k+1}][child][{$kk+1}][menu]" value="view" {eq name="$voo.type" value="view"}checked="checked"{/eq}> 跳转网页</label>
												<label class="checkbox-inline"> <input type="radio" onclick="changeRadio(this);" name="data[{$k+1}][child][{$kk+1}][menu]" value="click" {eq name="$voo.type" value="click"}checked="checked"{/eq}> 触发关键字</label>
												<label class="checkbox-inline"> <input type="radio" onclick="changeRadio(this);" name="data[{$k+1}][child][{$kk+1}][menu]" value="miniprogram" {eq name="$voo.type" value="miniprogram"}checked="checked"{/eq}> 跳转小程序</label>
												<!--<label class="checkbox-inline"> <input type="radio" onclick="changeRadio(this);" name="data[{$k+1}][child][{$kk+1}][menu]" value="scancode_push" {eq name="$voo.type" value="scancode_push"}checked="checked"{/eq}> 扫码（推事件）</label>-->
												<!--<label class="checkbox-inline"> <input type="radio" onclick="changeRadio(this);" name="data[{$k+1}][child][{$kk+1}][menu]" value="scancode_waitmsg" {eq name="$voo.type" value="scancode_waitmsg"}checked="checked"{/eq}> 扫码（等待信息）</label>-->
												<!--<label class="checkbox-inline"> <input type="radio" onclick="changeRadio(this);" name="data[{$k+1}][child][{$kk+1}][menu]" value="pic_sysphoto" {eq name="$voo.type" value="pic_sysphoto"}checked="checked"{/eq}> 系统拍照发图</label>-->
												<!--<label class="checkbox-inline"> <input type="radio" onclick="changeRadio(this);" name="data[{$k+1}][child][{$kk+1}][menu]" value="pic_photo_or_album" {eq name="$voo.type" value="pic_photo_or_album"}checked="checked"{/eq}> 拍照或者相册发图</label>-->
												<!--<label class="checkbox-inline"> <input type="radio" onclick="changeRadio(this);" name="data[{$k+1}][child][{$kk+1}][menu]" value="pic_weixin" {eq name="$voo.type" value="pic_weixin"}checked="checked"{/eq}> 微信相册发图</label>-->
												<!--<label class="checkbox-inline"> <input type="radio" onclick="changeRadio(this);" name="data[{$k+1}][child][{$kk+1}][menu]" value="location_select"{eq name="$voo.type" value="location_select"}checked="checked"{/eq}> 地理位置</label>-->
											</div>
										</div>
									</div>
									<div class="cm-edit-content-con {neq name='$voo.type' value='sendmsg'}none{/neq}" id="edit_sendmsg">
										<div class="editTab">
											<div class="editTab-heading">
												<ul id="clickUl" class="msg-panel-tab">
													<li class="msg-tab_item {eq name='$voo.material.type' value='2'} on {/eq}" onclick="changeType(this,'pic')">
														<span class="msg-icon msg-icon-tuwen"></span>
														图文消息
													</li>
													<!--<li class="msg-tab_item {eq name='$voo.material.type' value='1'} on {/eq}" onclick="changeType(this,'text');">-->
														<!--<span class="msg-icon msg-icon-word"></span>-->
														<!--文本-->
													<!--</li>-->
												</ul>
											</div>
											<div class="editTab-body">
												<div class="msg-panel-context">
													{notempty name="$voo.material_id"}
													<div class="msg-template">
														<input type="hidden" name="data[{$k+1}][child][{$kk+1}][material_id]" value="{$voo.material_id}">
														{eq name="$voo.material.type" value="1"}
														{$voo.material.intro}
														{else/}
														<img src="{$voo.material.litpic}" alt="">
														<div>{$voo.material.title}</div>
														{/eq}
													</div>
													{else/}
													<div class="msg-context-item" data-href="{:url('Gzh/selcet_material_list',['type'=>2])}" onclick="openFullframe(this, '选择素材', '80%', '80%');">
														<div class="msg-panel-center msg-panel-center">
															<span class="message-plus">+</span><br>从素材库中选择</div>
													</div>
													{/notempty}


												</div>
											</div>
										</div>
									</div>

									<div class="cm-edit-content-con {neq name='$voo.type' value='view'}none{/neq}" id="edit_view">
										<div class="cm-edit-page">
											<div class="row">
												<label class="col-sm-2 control-label" style="text-align: left;">点击菜单跳转到以下链接:</label>
												<div class="col-sm-5">
													<input type="text" name="data[{$k+1}][child][{$kk+1}][jump_url]" value="{$voo.jump_url}" class="form-control" placeholder="认证号才可手动输入地址">
													<span class="help-block">必填,必须是正确的URL格式</span>
												</div>
											</div>
										</div>
									</div>

									<div class="cm-edit-content-con {neq name='$voo.type' value='click'}none{/neq}" id="edit_click">
										<div class="cm-edit-page">
											<div class="row">
												<label class="col-sm-2 control-label" style="text-align: left;width: 150px;">关键字:</label>
												<input type="text" style="width: 200px;" id="key_{$k+1}_{$kk+1}" name="data[{$k+1}][child][{$kk+1}][key]" value="{$voo.key}" class="form-control" placeholder="必填,不超过128字节">
												<span class="key-choose" data-href="{:url('Gzh/selcet_keyword_list')}" onclick="openFullframe(this, '选择关键字', '80%', '80%');">选择</span>
											</div>
										</div>
									</div>

									<div class="cm-edit-content-con {neq name='$voo.type' value='edit_miniprogram'}none{/neq}" id="edit_miniprogram">
										<div class="cm-edit-page">
											<div class="row">
												<label class="col-sm-2 control-label" style="text-align: left;">网页链接:</label>
												<div class="col-sm-5">
													<input type="text" name="data[{$k+1}][child][{$kk+1}][url]" value="{$voo.url}" class="form-control" placeholder="认证号才可手动输入地址">
													<span class="help-block">必填,不支持小程序的老版本客户端将打开本url</span>
												</div>
											</div>
											<div class="row">
												<label class="col-sm-2 control-label" style="text-align: left;">小程序appid:</label>
												<div class="col-sm-5">
													<input type="text" name="data[{$k+1}][child][{$kk+1}][appid]" value="{$voo.appid}" class="form-control" placeholder="仅认证公众号可配置">
													<span class="help-block">必填</span>
												</div>
											</div>
											<div class="row">
												<label class="col-sm-2 control-label" style="text-align: left;">小程序的页面路径(pagepath):</label>
												<div class="col-sm-5">
													<input type="text" name="data[{$k+1}][child][{$kk+1}][path]" value="{$voo.path}" class="form-control" placeholder="pages/index/index">
													<span class="help-block">必填</span>
												</div>
											</div>
										</div>
									</div>

								</div>
								{/foreach}
							{/foreach}
						</div>
				</div>
			</div>
		</form>
		<div class="cm-edit-footer">
			<button type="button" class="btn btn-info1" onclick="check_submit(this);" data-url="{:url('Gzh/menu_index')}">保存</button>
			<!--<button id="synchroBtns" type="button" class="btn btn-info1">同步</button>-->
			<!--<button id="showPhone" type="button" class="btn btn-info1">预览</button>-->
			<button id="deleteMenu" type="button" class="btn btn-info1" onclick="emptyMenu();">清空菜单</button>
		</div>
	</div>
</div>
<script>
	var text_url = "{:url('Gzh/selcet_material_list',['type'=>1])}";
	var pic_url = "{:url('Gzh/selcet_material_list',['type'=>2])}";
	var keyword_url = "{:url('Gzh/selcet_keyword_list')}";

</script>
<script type="text/javascript" src="__SKIN__/js/gzh/menu.js"></script>
{include file="public/footer" /}
